// 为了管理项目的所有的接口

import myAxios from "./requestone";
import YouAxios from "./mock";
// 请求首页数据的接口
// 不会立即执行，懒加载原理，进行优化请求
// http://localhost:3001/api/banner/list
export const GETBannerData=()=>myAxios.get("/bannerList")
export const GETNavListData=()=> myAxios.get("/navList")
// 产品数据
export const GETSeckillList=()=>YouAxios.get("/pro/seckilllist")

// 产品列表
// http://121.89.205.189:3000/api/pro/categorylist

// http://localhost:3001/api/pro/search
export const GetCategoryList=(val)=>myAxios.get("pro/categorylist",{val})

export function getBannerList(proid){
     return myAxios.get("pro/detail/"+proid)
}
// 热门推荐列表http://localhost:3001/api/pro/recommendlist
export function GetHotListData(data){
     return myAxios.get("pro/recommendlist",data)
}
// 列表图片http://localhost:3001/api/pro/categorybrandprolist
export function Getphotolist(params){
     return myAxios.get("pro/categorybrandprolist",{params})
}
// 手机号是否被注册post
// http://localhost:3001/api/user/docheckphone
export function GETUserTel() {
     return myAxios.post("user/docheckphone/")
}
// 发送验证码
// http://121.89.205.189:3000/api/user/dosendmsgcode
export function GETYZM(data){
     return myAxios.post("user/dosendmsgcode",data)
}
// 验证验证码
// http://localhost:3001/api/user/docheckcode
export function  DoCheckCode(data){
     return myAxios.post('user/docheckcode',data)
}
// 注册
// http://localhost:3001/api/user/dofinishregister
export function  DoRegister(data){
     return myAxios.post('/user/dofinishregister',data)
}
// 登陆页面http://localhost:3001/api/user/login
export function GoLogin(data){
     return myAxios.post('/user/login',data)
}
// 修改密码http://localhost:3001/api/user/updatePassword
export function postMM(params){
     return myAxios.get('user/updatePassword',{params})
}
// 获取用户信息http://localhost:3001/api/user/info
export function GetMine(params){
     return myAxios.get("user/info",{params})
}
// 购物车
// http://localhost:3001/api/cart/list
export function GetCartlist(data){
     return myAxios.post("cart/list",data)
}
// 购物车删除单条数据
// http://localhost:3001/api/cart/remove
export function removeCartList(data){
     return myAxios.post("cart/remove",data)
}
// 加入购物车
// http://localhost:3001/api/cart/add
export function AddCartList(data){
     return myAxios.post("cart/add",data)
}
// 绑定值发上改变
// http://localhost:3001/api/cart/updatenum
export function ChangeNum(data) {
     return myAxios.post("cart/updatenum",data)
     
}
// Cart - 更新所有购物车数据的选中状态http://localhost:3001/api/cart/selectall
export function AllCartChecked(data) {
     return myAxios.post("cart/selectall",data)
}
// 更新当前购物车数据的选中状态http://localhost:3001/api/cart/selectone
export function IsCartChecked(data) {
     return myAxios.post("cart/selectone",data)
}
// 支付时删除购物车选中的数据http://localhost:3001/api/order/deleteCartItem
export function DelOrder(params) {
     return myAxios.get("order/deleteCartItem",{params})
}
// 分类页面
// 分类列表http://121.89.205.189:3000/api/pro/categorylist
export function GetKindList() {
     return myAxios.get("pro/categorylist")
}
// 分类下面的品牌列表http://localhost:3001/api/pro/categorybrandlist
export function Getbrandlist(params) {
     return myAxios.get("pro/categorybrandlist",{params})
}
// 分类品牌的图片http://localhost:3001/api/pro/categorybrandprolist
export function Getphoto(params){
     return myAxios.get("pro/categorybrandprolist",{params})
}

//获取某分类下某品牌的产品列表http://localhost:3001/api/pro/categorybrandprolist
// ==============
// 添加订单http://localhost:3001/api/order/addOrder
export function postAddBarData(data){
     return myAxios.post("order/addOrder",data)
}
// 获取确认订单的信息http://121.89.205.189:3000/api/order/confirmOrder

export function ConfirmOrder(params){
     return myAxios.get("order/confirmOrder",{params})
}
// 地址
// 地址列表：http://localhost:3001/api/address/list

export function getAddress(params){
     return myAxios.get("/address/list",{params})
}
// 添加地址http://localhost:3001/api/address/add
export function postAddress(data){
     return myAxios.post("address/add",data)
}
// 默认地址获取
// http://localhost:3001/api/address/defaultAddress
export function getMorenAddress(data){
     return myAxios.post("address/defaultAddress",data)
}
// 删除地址http://localhost:3001/api/address/delete

export function  AddressDelete(data){
     return myAxios.post("address/delete",data)
}

// 热门搜索http://localhost:3001/api/pro/hotword
export const GETHOTWord=(params)=>myAxios.get("pro/hotword",{
     params
})
// 搜索列表http://localhost:3001/api/pro/search
export function GetsearchDetail(params){
     return myAxios.get("/pro/search",{params})
}